home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / cool / cool.lha / ice / util / os2copy_imakefiles < prev    next >
Encoding:
Text File  |  1991-09-04  |  1.8 KB  |  70 lines

  1. #! /bin/csh
  2. #
  3. # Copyright (C) 1991 Texas Instruments Incorporated.
  4. #
  5. # Permission is granted to any individual or institution to use, copy, modify,
  6. # and distribute this software, provided that this complete copyright and
  7. # permission notice is maintained, intact, in all copies and supporting
  8. # documentation.
  9. #
  10. # Texas Instruments Incorporated provides this software "as is" without
  11. # express or implied warranty.
  12. #
  13. # ftp cool Imakefiles to an IBM PS/2
  14. # Usage: cd ice; util/os2copy_imakefiles <host> <login> <dir> <dir> ...
  15. # The directories to copy default to: cool
  16. #   ice_defs cpp CCC test util cool pisces
  17. #
  18. # Example: copy cool Imakefiles
  19. #   cd ice; util/os2copy_imakefiles blue ssb cool
  20. #
  21. # Example: copy just the String and String/tests Imakefiles
  22. #   cd ice; util/os2copy_imakefiles blue ssb cool/String
  23. #
  24.  
  25. if ($1 == "" || $2 == "") then
  26.   echo "Usage: util/os2copy_imakefiles <host> <login> [<dirs>]"
  27.   exit
  28. endif
  29.  
  30. set HOST = $1
  31. shift
  32. set LOGIN = $1
  33. shift
  34.  
  35. if $1 == "" then
  36.   set DIRS = "ice_defs cpp CCC test util cool pisces"
  37. else
  38.   set DIRS = $*
  39. endif
  40.  
  41. set ICE = `pwd`
  42.  
  43. # Create a temporary file containg all the directory names
  44. if (-e /tmp/cooldirs && "$1" == "") then
  45.  echo "using /tmp/cooldirs"
  46. else 
  47.  rm -f /tmp/cooldirs
  48.  touch /tmp/cooldirs
  49.  echo "ice" >> /tmp/cooldirs
  50.  foreach DIR ($DIRS)
  51.    echo "Finding $DIR directory"
  52.    echo "ice/$DIR" >> /tmp/cooldirs
  53.    (cd $ICE/..; find ice/$DIR/* -type d -print >> /tmp/cooldirs)
  54.  end
  55. endif
  56.  
  57. echo "open $HOST" > /tmp/ftp.script
  58. echo "$LOGIN" >> /tmp/ftp.script
  59. foreach DIR (`cat /tmp/cooldirs`)
  60.   set OS2DIR=`echo "$DIR" | sed -e s'@/@\\\\@'g -e 's/^/\\\\/'`
  61.   echo cd "$OS2DIR" >> /tmp/ftp.script
  62.   echo lcd "$ICE/../$DIR" >> /tmp/ftp.script
  63.   echo mput Imakefile >> /tmp/ftp.script
  64. end
  65. echo "close" >> /tmp/ftp.script
  66. echo "bye" >> /tmp/ftp.script
  67.  
  68. echo 'ftp -v -i < /tmp/ftp.script'
  69. /bin/time ftp -v -i < /tmp/ftp.script
  70.